package proyectobdii;

public class Controller_Connection {
    private DataBase databasei;
    private DataBase databaseii;

    public void ConnectBDI(String host, String user, String pass, String database) throws Exception{
        //Se utiliza getInstance para asegurar el funcionamiento del Singleton
        databasei = DataBase.getInstance(user, pass, host, database);
    }

    public void ConnectBDII(String host, String user, String pass, String database) throws Exception{
        //Se utiliza getInstance para asegurar el funcionamiento del Singleton
        databaseii = new DataBase(user, pass, host, database);
        databaseii.connect();
    }

    public DataBase getDataBaseI() {
        return databasei;
    }

    public DataBase getDataBaseII() {
        return databaseii;
    }

    public void disconnectDataBaseI() throws Exception{
        databasei.disconect();
    }

    public void disconnectBDII() throws Exception{
        databaseii.disconect();
    }
    
    public void setDataBase2(DataBase database){
        databaseii = database;
    }
}
